package com.enki.cigarettes.enums;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.enums
 * @Name e-cigarettes-shop-api-module
 * @Description: TODO (用一句话描述该文件做什么)
 * @date 2018/11/2
 */
public class PaymentEnums {


    /**
     * 支付方式
     */
    public enum PaymentChannel {
        UNDECIDED("待定", -1), BALANCE("余额", 0), ALIPAY("支付宝", 1), WECHAT("微信", 2), UNION_PAY("银联", 3), WELFARE("福利金", 4),OTHER("其他(0元支付)",5);
        private String name;
        private int method;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getMethod() {
            return method;
        }

        public void setMethod(int method) {
            this.method = method;
        }

        PaymentChannel(String name, int method) {
            this.name = name;
            this.method = method;
        }

        public static String getName(int method) {
            for (PaymentChannel pc: PaymentChannel.values()){
                if(pc.getMethod() == method) {
                    return pc.getName();
                }
            }
            return "";
        }
    }

}
